#被动技能【着弹预瞄圈】
execute at @a[tag=shinai,scores={skBow0=1..}] anchored eyes as @e[type=minecraft:spectral_arrow,distance=0..3] run tag @s add autoarrow

execute unless entity @a[tag=BossAlready] at @a[tag=!shinai,gamemode=!spectator] as @e[distance=0..3,type=spectral_arrow,tag=autoarrow] run tp @s ~ ~2.1 ~
execute unless entity @a[tag=BossAlready] at @a[tag=!shinai,gamemode=!spectator] as @e[distance=0..3,type=spectral_arrow,tag=autoarrow] run data merge entity @s {Motion:[0.0,-3.0,0.0]}

execute if entity @a[tag=BossAlready] at @a[team=King,gamemode=!spectator] as @e[distance=0..3,type=spectral_arrow,tag=autoarrow] run tp @s ~ ~2.1 ~
execute if entity @a[tag=BossAlready] at @a[team=King,gamemode=!spectator] as @e[distance=0..3,type=spectral_arrow,tag=autoarrow] run data merge entity @s {Motion:[0.0,-3.0,0.0]}



execute at @e[type=spectral_arrow,tag=autoarrow] run particle dripping_honey ~ ~ ~ 0.1 0.1 0.1 50 2 normal @a



#主武器【只有一发的12.7mm特质弹药】
execute as @a[tag=shinai,scores={skBow0=1..}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/shiyonggong

execute as @a[tag=shinai,tag=!jujifinish,tag=!juji,scores={skPlayer=1..6},nbt={SelectedItem:{id:"minecraft:bow"}}] run item replace entity @s weapon.offhand with minecraft:spectral_arrow{display: {Name: '[{"text":"12.7mm特质弹药","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]', Lore: ['{"text":"被动技能【着弹预测圈】","color":"dark_purple","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}', '{"text":"绝佳的狙击技艺，子弹射出几乎必中","color":"dark_green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}', '{"text":"箭自动锁定周围3格范围的敌人","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}']}} 1
tag @a[tag=shinai,tag=!juji,nbt={SelectedItem:{id:"minecraft:bow"}}] add juji

#【洛洛克】伤害
execute as @e[type=#arrows,nbt={PierceLevel:11b}] run data merge entity @s {damage:1d,PierceLevel:0b}
#副武器【使用洛洛克18】
scoreboard players remove @a[tag=shinai,scores={skCrossBow0=1..,skPlayer=1..}] skPlayer 1
tag @a[tag=shinai,scores={skCrossBow0=1..}] remove shouqiang
execute as @a[tag=shinai,scores={skCrossBow0=1..}] at @s run tp @s ~ ~ ~ ~ ~-7
scoreboard players reset @a[tag=shinai,scores={skCrossBow0=1..}] skCrossBow0

execute as @a[tag=shinai,tag=!shouqiang,scores={skPlayer=1..6}] if data entity @s {SelectedItem:{id:"minecraft:crossbow"}} run item replace entity @s weapon.offhand with minecraft:arrow{display: {Name: '[{"text":"9mm帕拉贝鲁姆子弹","color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]'}, Enchantments: [{id: "minecraft:loyalty", lvl: 10}]} 1
tag @a[tag=shinai,tag=!shouqiang,nbt={SelectedItem:{id:"minecraft:crossbow"}}] add shouqiang

#被动技能【弹夹满】
execute as @a[tag=shinai,scores={skPlayer=0}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/kongzhidanxia
#被动技能【辅助模拟装填系统】
execute as @a[tag=shinai,scores={skCDJPG=0}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/0zidonghuandan

#主动技能【预测弹道线】
execute as @a[tag=shinai,scores={skEgg=1..}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/1yucedandaoxian
#主动技能【预测弹道线】CD
execute as @a[tag=shinai,scores={skCDEgg=0}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/1yucedandaoxian_cd
#主动技能【卫星扫描接收器】
execute as @a[tag=shinai,scores={skEXBottle=1..}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/2jinengping
#主动技能【卫星扫描接收器】CD
execute as @a[tag=shinai,scores={skCDEXBottle=0}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/2jinengping_cd

#主动技能【高效实战换弹】
execute as @a[tag=shinai,scores={skJPG=1..}] at @s run function nw:yingxiong/1yingxiong/03jujishou/skill/3kuaisuhuandan

#被动技能【TPF枪械恐惧症】
execute if entity @a[tag=BossAlready] as @a[tag=shinai] at @s if entity @a[distance=0.1..4,team=King] run effect give @s slowness 1 0 true
execute if entity @a[tag=BossAlready] as @a[tag=shinai] at @s if entity @a[distance=0.1..4,team=King] run effect give @s blindness 2 0 true

execute unless entity @a[tag=BossAlready] as @a[tag=shinai] at @s if entity @a[distance=0.1..4] run effect give @s slowness 1 0 true
execute unless entity @a[tag=BossAlready] as @a[tag=shinai] at @s if entity @a[distance=0.1..4] run effect give @s blindness 2 0 true

#被动技能【非效用弹匣无效】
tag @a[tag=shinai,nbt=!{SelectedItem:{id:"minecraft:crossbow"}}] remove shouqiang
tag @a[tag=shinai,nbt=!{SelectedItem:{id:"minecraft:bow"}}] remove juji
clear @a[tag=shinai,nbt={SelectedItem:{id:"minecraft:crossbow",Count:1b}}] spectral_arrow
clear @a[tag=shinai,nbt={SelectedItem:{id:"minecraft:bow",Count:1b}}] arrow




execute as @a[tag=shinai] run title @s actionbar [{"text":"终端扫描接收器","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEXBottle","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 弹道预测线","color":"dark_red","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"正在冷却：","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skCDEgg","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"s","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":" 弹药剩余：","color":"green","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"score":{"objective":"skPlayer","name":"@s"},"color":"aqua","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"/","color":"dark_red","bold":true,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false},{"text":"6","color":"gold","bold":false,"italic":false,"underlined":false,"strikethrough":false,"obfuscated":false}]
